package com.lwh.constant;

import java.time.format.DateTimeFormatter;

/**
 * @Description:
 * @Date: 2019-08-08
 * @author: luowuhui
 */
public class Constant {

	/**
	 * 时间格式
	 */
	public static class DateFormatter {
		public static final DateTimeFormatter YYYYMMDD      = DateTimeFormatter.ofPattern("yyyyMMdd");
		public static final DateTimeFormatter UTC_DATA_TIME = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
	}

	/**
	 * 常用long值
	 */
	public static class LongPug {
		public static final long TIMESTAMP_SECOND = 1000L;
		public static final long TIMESTAMP_MINUTE = 1000L * 60L;
		public static final long TIMESTAMP_HOUR   = 1000L * 60L * 60L;
		public static final long TIMESTAMP_DAY    = 1000L * 60L * 60L * 24L;
		public static final long TIMESTAMP_WEEK   = 1000L * 60L * 60L * 24L * 7L;
		public static final long BYTE_KB          = 1 << 10;
		public static final long BYTE_MB          = 1 << 20L;
		public static final long BYTE_GB          = 1 << 30L;
	}

	public static class PatternPug {
		public static final String URL_PATTERN   = "^((https|http|ftp|rtsp|mms)?:\\/\\/)[^\\s]+";
		public static final String EMAIL_PATTERN = "\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}";
		public static final String IP_PATTERN    = "(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)";
	}

}
